package com.ease.model;

import java.io.Serializable;

import com.ease.common.util.DateFormatUtil;
import com.ease.model.criteria.Criteria;
import com.ease.model.criteria.CriteriaType;

/**
 * 
 * @author nathanleewei
 * 
 */
public interface Model extends Serializable {

	public static final long VERSION = 1;

	public static final long RAW_ID = 0;

	public static final String DATATIME_FORMAT = DateFormatUtil.FORMAT_DATETIME;

	public static final String Attribute_id = "id";

	public static final String Attribute_ids = "ids";

	public static final String Attribute_name = "name";

	public static final String Attribute_nameLike = "nameLike";

	public static final String Attribute_version = "version";

	//
	public static final String Column_ID = "ID";

	public static final String Column_NAME = "NAME";

	public static final String Column_VERSION = "VERSION";

	/**
	 * use beNew instead of isNew for escape from JSON marshaling
	 * 
	 * @return
	 */
	boolean beNew();

	/**
	 * 
	 * @return
	 */
	String namespace();

	/**
	 * 
	 * @return
	 */
	@Criteria(type = CriteriaType.PrimaryKey)
	long getId();

	/**
	 * 
	 * @param id
	 */
	void setId(long id);

	/**
	 * @return Returns the name.
	 */
	String getName();

	/**
	 * @param name
	 *            The name to set.
	 */
	void setName(String name);

	/**
	 * 
	 * @return
	 */
	@Criteria(type = CriteriaType.Positive)
	long getVersion();

	/**
	 * 
	 * @param version
	 */
	void setVersion(long version);
}
